package com.by.hazelcasttopic.properties;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;
import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ConditionalOnProperty(name = "by.hazelcasttopic.enabled", havingValue = "true")
@ConfigurationProperties(prefix = "by.hazelcasttopic")
public class HazelcastTopicProperties {

    private String k8sNameSpace;

    private Map<String, Config> clusterMap;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Config {

        private String serviceName;

        private int servicePort;

        private int port;

        private List<String> topics;

    }

}
